<script setup>
import { useRouter } from 'vue-router';

const router = useRouter();
const getUser = () => {
    router.push({
        path: '/User',
        query: {
            name: '张三',
            age: 23
        }
    });
}
</script>

<template>
    <div>
        Home<button @click="getUser">获取学生信息</button>
    </div>
</template>